{template "header.html"}


<form action="" class="form-horizontal" method="post" name="myform" id="myform">
    {$form}
    <div class="portlet bordered light myfbody">
        <div class="portlet-title tabbable-line">
            <ul class="nav nav-tabs" style="float:left;">
                <li class="{if $page==0}active{/if}">
                    <a href="#tab_0" data-toggle="tab" onclick="$('#dr_page').val('0')"> <i class="fa fa-cog"></i> {dr_lang('插件设置')} </a>
                </li>

            </ul>
        </div>
        <div class="portlet-body">
            <div class="tab-content">

                <div class="tab-pane {if $page==0}active{/if}" id="tab_0">
                    <div class="form-body">

                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('权限模式')}</label>
                            <div class="col-md-9">
                                <input type="checkbox" name="data[open]" value="1" {if $data['open']}checked{/if} data-on-text="{dr_lang('按等级模式')}" data-off-text="{dr_lang('按用户组模式')}" data-on-color="success" data-off-color="danger" class="make-switch" data-size="small">

                            </div>
                        </div>



                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('按用户组设置')}</label>
                            <div class="col-md-9">
                                <div class="table-scrollable">
                                    <table class="fc-cat-table table table-striped table-bordered  table-checkable dataTable">
                                        <thead>
                                        <tr class="heading">
                                            <th width="200" style="height: 40px"></th>
                                            <th width="200">{dr_lang('附件总空间')}</th>
                                            <th></th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        {loop $ci->member_cache['group'] $i $t}
                                        <tr class="odd gradeX">

                                            <td >{$t.name}</td>

                                            <td>
                                                <div class="input-inline input-medium">
                                                    <div class="input-group">
                                                        <input type="text"  name="data[group][{$i}]" value="{$data[group][$i]}" class="form-control" placeholder="">
                                                        <span class="input-group-addon">
                                                                MB
                                                            </span></div>
                                                </div>
                                            </td>
                                            <td ></td>

                                        </tr>
                                        {/loop}
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('按等级设置')}</label>
                            <div class="col-md-9">
                                <div class="table-scrollable">
                                    <table class="fc-cat-table table table-striped table-bordered  table-checkable dataTable">
                                        <thead>
                                        <tr class="heading">
                                            <th width="200" style="height: 40px"></th>
                                            <th width="200">{dr_lang('附件总空间')}</th>
                                            <th></th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        {loop $ci->member_cache['group'] $i $t}
                                        {if $t.level}
                                        <tr class="odd gradeX">
                                            <td colspan="99"> {$t.name} </td>

                                        </tr>
                                        {loop $t.level $ii $it}
                                        <tr class="odd gradeX">
                                            <td style="padding-left: 50px;">{$it.name}</td>
                                            <td>
                                                <div class="input-inline input-medium">
                                                    <div class="input-group">
                                                        <input type="text"  name="data[level][{$ii}]" value="{$data[level][$ii]}" class="form-control" placeholder="">
                                                        <span class="input-group-addon">
                                                                MB
                                                            </span></div>
                                                </div>
                                            </td>
                                            <td> </td>
                                        </tr>
                                        {/loop}
                                        {/if}
                                        {/loop}
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('规则说明')}</label>
                            <div class="col-md-9">
                                <p class="help-block">{dr_lang('按组和按等级设置权限，只能生效其中一个')}</p>
                                <p class="help-block">{dr_lang('设置0或者空时，表示不限制附件大小')}</p>
                                <p class="help-block">{dr_lang('当用户所属多个用户组时，按最大值优先计算')}</p>
                                <p class="help-block">{dr_lang('当用户是后台管理员角色时，不受附件大小限制')}</p>
                            </div>
                        </div>



                    </div>
                </div>



            </div>
        </div>
    </div>

    <div class="portlet-body form myfooter">
        <div class="form-actions text-center">
            <button type="button" onclick="dr_ajax_submit('{dr_now_url()}&page='+$('#dr_page').val(), 'myform', '2000')" class="btn green"> <i class="fa fa-save"></i> {dr_lang('保存')}</button>
        </div>
    </div>
</form>
{template "footer.html"}